import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../components/HelloWorld.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/index',
    children:[
      {
        path:'/index',
        name:"index",
        component:()=>import("../views/index")
      },
      {
        path:'/course',
        name:"course",
        component: () => import("../views/course")
      },
      {
        path:'/record',
        name:"record",
        component: () => import("../views/record")
      },
      {
        path:'/practice',
        name:"practice",
        component: () => import("../views/practice")
      },
      {
        path:'/login',
        name:"login",
        component: () => import("../views/login")
      },
    ]
  },
  {
    path: '/courceDetail/:id?',
    name: "courceDetail",
    component: () => import("../views/particulars/courceDetail")
  },
  {
    path: '/coursedet/:id?',
    name: "coursedet",
    component: () => import("../views/particulars/coursedet")
  },
  {
    path: '/teacherDetail/:id?',
    name: "teacherDetail",
    component: () => import("../views/particulars/teacherDetail")
  },
  {
    path: '/search',
    name: "search",
    component: () => import("../views/particulars/search")
  },
]

const router = new VueRouter({
  routes
})

export default router
